import { requestSearchList } from "@/api"

// vuex的search模块配置
const state={
    searchList :{}
}
const mutations ={
    SET_SEARCHLIST_STATE(state,value){
        state.searchList=value
    }
}
const actions = {
    //异步发送三级列表数据请求
    async getSearchList({commit},searchParams){
        const result = await requestSearchList(searchParams)
        commit('SET_SEARCHLIST_STATE',result)
    }
}
const getters = {
    trademarkList(state) {
        return state.searchList.trademarkList;
      },
      attrsList(state) {
        return state.searchList.attrsList;
      },
      goodsList(state) {
        return state.searchList.goodsList;
      },
} 
export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}